/**
 * Created with IntelliJ IDEA.
 * Description:
 */
public class Demo4 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 =new Thread(()->{
           for (int i=0;i<3;i++){
               System.out.println("t1");
               try {
                   Thread.sleep(1000);
               } catch (InterruptedException e) {
                   throw new RuntimeException(e);
               }
           }

        });
        System.out.println(t1.isAlive());
        t1.start();
        while (true){
            System.out.println(t1.isAlive());
            Thread.sleep(1000);
        }
    }
}
